﻿using UnityConfiguration.Infrastructure;
using mpu = Microsoft.Practices.Unity;

namespace UnityConfiguration
{
    /// <summary>
    /// This class provides a base class for configuration
    /// of a Unity container using user-installed container
    /// extensions.
    /// </summary>
    public class ExtensionConfiguration : TypeResolvingObject, IContainerConfigurationCommand
    {
        private string _Name;
        private string _TypeName;
        /// <summary>
        /// Name of this configuration element. Names must be unique.
        /// </summary>
        public string Name {
            get { return _Name; }
            set { _Name = value; }
        }

        /// <summary>
        /// Concrete type name for this configuration element.
        /// </summary>
        public string TypeName {
            get { return _TypeName; }
            set { _TypeName = value; }
        }

        /// <summary>
        /// Execute this command against the given container.
        /// </summary>
        /// <remarks>
        /// Interface implementors will implement this method to
        /// apply configuration changes to the container.</remarks>
        /// <param name="container">The <see cref="IUnityContainer"/> to configure.</param>
        public virtual void Configure(mpu.IUnityContainer container) {

        }
    }
}
